﻿package mortal.game.scene3D.display3d.blood.bossBlood
{
    import __AS3__.vec.*;

    public class BossBloodFactory extends Object
    {
        private static var _pool:Array = new Array();
        private static const defaultBlood:BossBlood3D = new BossBlood3D();

        public function BossBloodFactory()
        {
            return;
        }// end function

        public static function createBlood3D() : BossBlood3D
        {
            var _loc_1:BossBlood3D = null;
            var _loc_2:Vector.<Number> = null;
            if (_pool.length > 0)
            {
                _loc_1 = _pool.pop();
                _loc_1.show();
            }
            else
            {
                _loc_2 = BossBlood3DRender.instance.list1Values;
                if (_loc_2.length >= 12 * 4)
                {
                    _loc_1 = defaultBlood;
                }
                else
                {
                    _loc_1 = new BossBlood3D();
                    _loc_1.reInit(_loc_2);
                }
            }
            return _loc_1;
        }// end function

        public static function disposeBlood3D(param1:BossBlood3D) : void
        {
            if (param1.parent)
            {
                param1.parent = null;
            }
            param1.hide();
            if (param1 != defaultBlood && _pool.indexOf(param1) == -1)
            {
                _pool.push(param1);
            }
            return;
        }// end function

    }
}
